using UnityEngine;

[ExecuteInEditMode]
public class PresetsPlatformHinge : MonoBehaviour
{
	public float platformLenght = 1f;

	public float platformAngle;

	private ControllerPlatformHinge controller;

	private void LateUpdate()
	{
		if (Application.isEditor && !Application.isPlaying)
		{
			if (controller == null)
			{
				controller = base.gameObject.GetComponent<RemoteControl>().controller.GetComponent<ControllerPlatformHinge>();
				platformLenght = controller.platformLenght;
				platformAngle = controller.platformAngle;
			}
			SetValues();
		}
	}

	public void SetValues()
	{
		if (platformLenght < 0.1f)
		{
			platformLenght = 0.1f;
		}
		if (controller != null)
		{
			controller.platformLenght = platformLenght;
			controller.platformAngle = platformAngle;
		}
	}
}
